home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 789 b | 45 lines | [TEXT/CWIE] |
- // ActivationLink.h
-
- #ifndef ActivationLink_h
- #define ActivationLink_h
-
- #ifndef Activator_h
- #include "Activator.h"
- #endif
-
- template < class Target >
- class ActivationLink: public Activator
- {
- typedef Target TargetType;
-
- private:
- Target& target;
- void (TargetType::*activate)();
- void (TargetType::*deactivate)();
-
- public:
- ActivationLink( Focus& focus,
- Target& theTarget,
- void (TargetType::*activator)(),
- void (TargetType::*deactivator)() )
- : Activator( focus ),
- target( theTarget ),
- activate( activator ),
- deactivate( deactivator )
- {}
-
- virtual void Activate()
- {
- if ( activate != 0 )
- (this->*activate)();
- }
-
- virtual void Deactivate()
- {
- if ( deactivate != 0 )
- (this->*deactivate)();
- }
- };
-
- #endif
-